<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>有贝口腔网-口腔问题-口腔问答-就上有贝口腔网 </title>
    <meta name="keywords" content="有贝口腔网,口腔网,口腔知识,口腔问答,口腔问题">
    <meta name="description" content="有贝口腔网是一家专注互联网口腔服务网站，为用户提供腔知识,口腔资讯,口腔问题,口腔问答,口腔诊所,诊所入住,口腔厂家,厂家入住,在线看牙等综合服务口腔网站">
    <link rel="stylesheet" href="/css/swiper.min.css">
    <link rel="stylesheet" href="/css/reset.css">
    <link rel="stylesheet" href="/css/commone.css">
    <link rel="stylesheet" href="/css/commthree.css">
    <link rel="stylesheet" media="screen and (min-width:481px)" href="/css/quesansw.css">
    <link rel="stylesheet" media="screen and (max-width:480px)" href="/css/quesansw(1).css">


    <script src="/js/hm.js"></script>
    <script type="text/javascript">
        var basePath = "/";
    </script>
    <!--<script src="/js/common.js"></script>-->
    <script src="/js/jquery-3.5.1.min.js"></script>
    <script src="/js/footfixed.js"></script>

    <script src="/js/right-lub.js"></script>
    <!--<script src="/js/qaindex.js"></script>-->
    <script src="/js/swiper.min.js"></script>
    <script src="http://www.hasbei.com/static/layer/layer.js" type="text/javascript"></script>
    <link rel="stylesheet" href="http://www.hasbei.com/static/layer/theme/default/layer.css?v=3.1.1"
          id="layuicss-layer">
</head>
<body>
<div class="content">

    <!--头部-->
    <div class="content-top">
        <div th:include="/user_page/usercenter_head :: usercenterhead"></div>
    </div>
    <!--分类-->
    <div th:replace="answers/answers_title"></div>


    <div class="content-main">
        <div class="box-bg-shadow">
            <div class="main-info-list">

                <div class="list-item">
                    <ul class="list-item-tab">
                        <li id="synthesize" class='list-item-tab-active'>
                            <a href="#" th:onclick="|javascript:synthesize()|">推荐</a>
                        </li>
                        <li id="already-answered">
                            <a href="#" th:onclick="|javascript:already_answered()|">已回答</a>
                        </li>
                        <li id="unanswered">
                            <a href="#" th:onclick="|javascript:unanswered()|">未回答</a>
                        </li>
                    </ul>
                </div>
                <div id="myContent">
                    <div class="list-item" th:each="question:${pages.getList()}">
                        <!-- 问题配图 -->
                        <div class="list-item-top">
                            <!--类型-->
                            <a th:each="title,iterStat:${listTitle}" th:if="${title.getTid()} eq ${question.getTitle().getTid()} " target="_blank" class="type" th:href="@{'/answers/main/'+${iterStat.index}+'/'+${question.getTitle().getTid()}}">[[${question.getTitle().getTname()}]]</a>
                            <a th:if="${question.getQCommentSum()} gt 0" target="_blank" class="ansewer type" th:href="@{'/answers/particulars/'+${question.getQId()}}">已答</a>
                            <a th:if="${question.getQCommentSum()} eq 0" target="_blank" class="ansewer type" th:href="@{'/answers/particulars/'+${question.getQId()}}">未答</a>
                            <a target="_blank" class="place" th:href="@{'/answers/particulars/'+${question.getQId()}}">邀请您回答</a>
                        </div>

                        <div class="list-item-title">
                            <a target="_blank" th:href="@{'/answers/particulars/'+${question.getQId()}}">[[${question.getQContent()}]]</a>
                        </div>

                        <div th:if="${question.getQAbstract()} ne null" class="list-item-content-text">
                            <a target="_blank" th:href="@{'/answers/particulars/'+${question.getQId()}}">[问题背景] [[${question.getQAbstract()}]]</a>
                        </div>

                        <div class="list-item-content-text" th:if="${question.getQCommentSum()} gt 0">
                            <div class="text-ansower-user">
                                <a target="_blank" th:href="@{'/answers/particulars/'+${question.getQId()}}" class="user-img-name">
                                    <img src="/icon/user_Default.png" th:if="${question.getUserR().getUImgUrl()} eq null">
                                    <img th:src="@{${question.getUserQ().getUImgUrl()}}" th:if="${question.getUserR().getUImgUrl()} ne null">
                                    <span class="user-name">[[${question.getUserQ().getUName()}]]</span>
                                </a>
                                <p class="text-ansower-p">
                                    <!-- <span class="text-ansower-line"></span> -->
                                    <span class="text-ansower-huida">[回答内容]</span>
                                </p>
                            </div>
                            <p class="text-ansower-content">
                                <a target="_blank" th:href="@{'/answers/particulars/'+${question.getQId()}}">
                                    [[${question.getUserR().getRAbstract()}]]
                                </a>
                            </p>
                        </div>

                        <div class="list-item-info" >
                            <div class="list-item-info-left">
                                <a target="_blank" th:href="@{'/answers/particulars/'+${question.getQId()}}" class="user-img-name">
                                    <img src="/icon/user_Default.png" th:if="${question.getUserQ()} eq null">
                                    <img th:src="@{${question.getUserQ().getUImgUrl()}}" th:if="${question.getUserQ()} ne null">
                                    <span class="user-name" th:if="${question.getUserQ()} ne null">[[${question.getUserQ().getUName()}]]</span>
                                </a>
                                <span class="time">[[${question.getQOkDate()}]]</span>
                                <a target="_blank" class="huida" th:href="@{'/answers/particulars/'+${question.getQId()}}">[[${question.getQCommentSum()}]]个回答</a>
                                <span class="dotted"></span>
                                <a target="_blank" class="liulan" th:href="@{'/answers/particulars/'+${question.getQId()}}">[[${question.getQReadSum()}]]阅读</a>
                                <span class="dotted"></span>
                                <a target="_blank" class="liulan" th:href="@{'/answers/particulars/'+${question.getQId()}}">[[${question.getQCollectSum()}]]收藏</a>
                            </div>
                            <div class="list-item-info-right">
                                <a target="_blank" th:href="@{'/answers/particulars/'+${question.getQId()}}">
                                    <img src="/icon/Write.png" alt="有贝口腔网">
                                    <span>我要回答</span>
                                </a>
                            </div>
                        </div>
                    </div>

                    <!----------------------------------------------------------->


                    <div class="list-item">
                        <!-- 问题配图 -->
                        <div class="list-item-top">
                            <a target="_blank" class="type" href="/qa/5">美白</a>
                            <a  target="_blank" class="ansewer type" href="#">已答</a>
                            <a target="_blank" class="place" href="#">邀请您回答</a>
                        </div>
                        <div class="list-item-title">
                            <a target="_blank" href="/qa/detail/202008051290934437198041088">想知道烤瓷牙还能做牙齿美白吗？</a>
                        </div>


                        <div class="list-item-content-text">
                            <div class="text-ansower-user">
                                <a target="_blank" href="/answers/1282955775085514752" class="user-img-name">
                                    <img src="http://rs.hasbei.com/header_images/c41ffe965b044a50a5701b676fb44e26.png">
                                    <span class="user-name">有贝口腔网 王白石</span>
                                </a>
                                <p class="text-ansower-p">
                                    <!-- <span class="text-ansower-line"></span> -->
                                    <span class="text-ansower-huida">[回答内容]</span>
                                </p>
                            </div>
                            <p class="text-ansower-content">
                                <a target="_blank" href="/answers/1282955775085514752">
                                    一般是不可以的，烤瓷牙是前牙美容修复的一种办法，前牙美容修复主要包括烤瓷牙和全瓷牙，除非是可以做一些瓷贴面修复，还要根据原来烤瓷冠的颜色的匹配。
                                </a>
                            </p>
                        </div>


                        <div class="list-item-info">
                            <div class="list-item-info-left">
                                <a target="_blank" href="/user/1281956384941936640" class="user-img-name">
                                    <img src="http://rs.hasbei.com/010.jpg">
                                    <span class="user-name">长安守备</span>
                                </a>
                                <span class="time">21小时前</span>
                                <a target="_blank" class="huida" href="/qa/detail/202008051290934437198041088">1个回答</a>
                                <span class="dotted"></span>
                                <a target="_blank" class="liulan" href="/qa/detail/202008051290934437198041088">4阅读</a>
                            </div>
                            <div class="list-item-info-right">
                                <a target="_blank" href="/qa/detail/202008051290934437198041088">
                                    <img src="/icon/Write.png" alt="有贝口腔网">
                                    <span>我要回答</span>
                                </a>
                            </div>
                        </div>
                    </div>

                </div>

                <div class="more-content">
                    <div class="load-more" style="display:none;">
                        <img src="/img/load-more.gif" alt="有贝口腔网">
                        <span>加载中</span>
                    </div>
                    <div id="loadData" class="load-more-two load-more-fade" onclick="loadData(this)">点击加载更多</div>
                    <div id="no-data" class="no-data" style="display:none;">-- 没有数据啦,我是有底线的哦 --</div>
                </div>

            </div>
        </div>

        <div class="aside-left">

            <div th:replace="common/tooth_function"></div>

            <div class="wonderful-top">
                <div class="wonderful-top-title">
                    <!-- <img src="/static/images/rmd.png" alt="有贝口腔网"> -->
                    <span>大家都在问</span>
                </div>
                <div class="wonderful-ansewer-list">

                    <div class="ansewer-list-item" th:each="question,iterStat:${listQuestion}">
                        <span th:class="${iterStat.count <= 3}?'pink-bg':''">[[${iterStat.count}]]</span>
                        <div>
                            <a target="_blank" class="ansewer-list-title" th:href="@{'/answers/particulars/'+${question.getQId()}}">[[${question.getQContent()}]]</a>
                            <div class="ansewer-list-info">
                                <a target="_blank" th:href="@{'/answers/particulars/'+${question.getQId()}}">
                                    <!-- <img src="/static/images/Write.png" alt=""> -->
                                    <span class="ansewer-list-info-ansewer">回答</span>
                                </a>
                                <a target="_blank" th:href="@{'/answers/particulars/'+${question.getQId()}}">[[${question.getQCommentSum()}]]个回答</a>
                                <span class="dotted"></span>
                                <a target="_blank" th:href="@{'/answers/particulars/'+${question.getQId()}}">[[${question.getQReadSum()}]]阅读</a>
                                <span class="dotted"></span>
                                <a target="_blank" th:href="@{'/answers/particulars/'+${question.getQId()}}">[[${question.getQCollectSum()}]]收藏</a>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>

    </div>

    <div th:replace="common/hasbei_bottom"></div>


    <script th:inline="javascript">
        /* <![CDATA[ */

        var pages = {
            pageSize:5,
            startPage:1,
            type:[[${tid}]],
            state:1,
            alreadyAnsweredOrUnanswered:0
        }

        function synthesize() {//推荐

            pages.startPage = 1;
            pages.alreadyAnsweredOrUnanswered = 0;

            //css样式
            $("#synthesize").addClass("list-item-tab-active");
            $("#already-answered").removeClass("list-item-tab-active");
            $("#unanswered").removeClass("list-item-tab-active");

            $.ajax({
                //请求方式
                type : "POST",
                //请求的媒体类型
                contentType: "application/json;charset=UTF-8",
                //请求地址
                url : "/question/inquirePages",
                //数据，json字符串
                data : JSON.stringify(pages),
                //请求成功
                success : function(result) {
                    console.log(result);
                    var list = result.data.list;
                    if(list != null && list.length >= 0){
                        show(list,"replace");//替换显示
                    }else{
                        layer.msg('-- 没有此类哦 --');
                    }
                    $('#no-data')[0].style.display = 'none';
                    $('#loadData')[0].style.display = 'block';
                },
                //请求失败，包含具体的错误信息
                error : function(e){
                    console.log(e.status);
                    console.log(e.responseText);
                }
            });
        }

        function already_answered() {/*已答*/
            pages.startPage = 1;
            pages.alreadyAnsweredOrUnanswered = 1;

            //css样式
            $("#already-answered").addClass("list-item-tab-active");
            $("#unanswered").removeClass("list-item-tab-active");
            $("#synthesize").removeClass("list-item-tab-active");

            $.ajax({
                //请求方式
                type : "POST",
                //请求的媒体类型
                contentType: "application/json;charset=UTF-8",
                //请求地址
                url : "/question/inquirePages",
                //数据，json字符串
                data : JSON.stringify(pages),
                //请求成功
                success : function(result) {
                    console.log(result);
                    var list = result.data.list;
                    if(list != null && list.length >= 0){
                        show(list,"replace");//替换显示
                    }else{
                        layer.msg('-- 没有此类哦 --');
                    }
                    $('#no-data')[0].style.display = 'none';
                    $('#loadData')[0].style.display = 'block';
                },
                //请求失败，包含具体的错误信息
                error : function(e){
                    console.log(e.status);
                    console.log(e.responseText);
                }
            });

        }

        function unanswered() {/*未答*/
            pages.startPage = 1;
            pages.alreadyAnsweredOrUnanswered = 2;

            //css样式
            $("#unanswered").addClass("list-item-tab-active");
            $("#already-answered").removeClass("list-item-tab-active");
            $("#synthesize").removeClass("list-item-tab-active");

            $.ajax({
                //请求方式
                type : "POST",
                //请求的媒体类型
                contentType: "application/json;charset=UTF-8",
                //请求地址
                url : "/question/inquirePages",
                //数据，json字符串
                data : JSON.stringify(pages),
                //请求成功
                success : function(result) {
                    console.log(result);
                    var list = result.data.list;
                    if(list != null && list.length >= 0){
                        show(list,"replace");//替换显示
                    }else{
                        layer.msg('-- 没有此类哦 --');
                    }
                    $('#no-data')[0].style.display = 'none';
                    $('#loadData')[0].style.display = 'block';
                },
                //请求失败，包含具体的错误信息
                error : function(e){
                    console.log(e.status);
                    console.log(e.responseText);
                }
            });
        }

        function loadData(thisDom) {/*加载更多*/
            pages.startPage = (pages.startPage+1);

            $.ajax({
                //请求方式
                type: "POST",
                //请求的媒体类型
                contentType: "application/json;charset=UTF-8",
                //请求地址
                url: "/question/inquirePages",
                //数据，json字符串
                data: JSON.stringify(pages),
                //请求成功
                success: function (result) {
                    console.log(result);
                    var list = result.data.list;
                    if(list != null && list.length > 0){
                        show(list,"addTo");//追加显示
                    }else{
                        pages.startPage = (pages.startPage-1);

                        thisDom.style.display = 'none';
                        $('#no-data')[0].style.display = 'block';
                        layer.msg('-- 没有数据啦,我是有底线的哦 --');
                    }
                },
                //请求失败，包含具体的错误信息
                error: function (e) {
                    console.log(e.status);
                    console.log(e.responseText);
                }
            });
        }


        function show(list,str) {//渲染函数

            var listTitle = [[${listTitle}]];

            var $myContent=$("#myContent");

            var html = "";

            for (let i=0;i < list.length;i++){

                html += "<div class='list-item'>";
                html += "<!-- 问题配图 -->";
                html += "<div class='list-item-top'>";

                for (let e=0;e<listTitle.length;e++){
                    if(listTitle[e].tname == list[i].title.tname){
                        html += "<a target='_blank' class='type' href='/question/main/"+e+"/"+list[i].title.tid+"'>"+list[i].title.tname+"</a>";
                    }
                }

                if(list[i].qcommentSum > 0){
                    html += "<a  target='_blank' class='ansewer type' href='#'>已答</a>";
                }else{
                    html += "<a target='_blank' class='ansewer type' href='#'>未答</a>";

                }
                html += "<a target='_blank' class='place' href='#'>邀请您回答</a>";
                html += "</div>";

                html += "<div class='list-item-title'>";
                html += "<a target='_blank' href='/qa/detail/202008051290934437198041088'>"+list[i].qcontent+"</a>";
                html += "</div>";

                if(list[i].qabstract != null){
                    html += "<div  class='list-item-content-text'>";
                    html += "<a target='_blank' href='#'>"+list[i].qabstract+"</a>";
                    html += "</div>";
                }

                if(list[i].qcommentSum > 0){
                    html += "<div class='list-item-content-text'>";
                    html += "<div class='text-ansower-user'>";
                    html += " <a target='_blank' href='/answers/1282955775085514752' class='user-img-name'>";

                    if(list[i].userR.uimgUrl != null){
                        html += "<img src='"+list[i].userR.uimgUrl+"'>";
                    }else{
                        html += "<img src='/icon/user_Default.png' />";
                    }

                    html += "<span class='user-name'>"+list[i].userR.uname+"</span>";
                    html += "</a>";
                    html += " <p class='text-ansower-p'>";
                    html += "<!-- <span class='text-ansower-line'></span> -->";
                    html += "<span class='text-ansower-huida'>[回答内容]</span>";
                    html += "</p>";
                    html += "</div>";
                    html += "<p class='text-ansower-content'>";
                    html += "<a target='_blank' href='#'>";
                    html += list[i].userR.rabstract;
                    html += " </a>";
                    html += " </p>";
                    html += "</div>";
                }

                html += "<div class='list-item-info'>";
                html += "<div class='list-item-info-left'>";
                html += "<a target='_blank' href='/user/1281956384941936640' class='user-img-name'>";
                if(list[i].userQ.uimgUrl != null){
                    html += "<img src='"+list[i].userQ.uimgUrl+"'>";
                }else{
                    html += "<img src='/icon/user_Default.png' />";
                }
                html += " <span class='user-name'>"+list[i].userQ.uname+"</span>";
                html += "</a>";
                html += "<span class='time'>"+list[i].qokDate+"</span>";
                html += "<a target='_blank' class='huida' href='#'>"+list[i].qcommentSum+"个回答</a>";
                html += " <span class='dotted'></span>";
                html += " <a target='_blank' class='liulan' href='#'>"+list[i].qreadSum+"阅读</a>";
                html += " <span class='dotted'></span>";
                html += " <a target='_blank' class='liulan' href='#'>"+list[i].qcollectSum+"收藏</a>";
                html += " </div>";
                html += " <div class='list-item-info-right'>";
                html += " <a target='_blank' href='#'>";
                html += " <img src='/icon/Write.png' alt='有贝口腔网'>";
                html += " <span>我要回答</span>";
                html += "</a>";
                html += "</div>";
                html += "</div>";
                html += "</div>";
            }
            if(str == "addTo"){
                $myContent.append(html);
            }else if(str == "replace"){
                $myContent.html(html);
            }
        }

        /* ]]> */
    </script>

</div>
</body>
</html>